package domain;

import java.io.Serial;
import java.io.Serializable;
import java.util.Objects;

public class User implements Serializable {
    @Serial
    private static final long serialVersionUID = 850867539746671600L;
    private String userName;
   private String passWord;


    public User() {
    }

    public User(String name, String passWord) {
        this.userName = name;
        this.passWord = passWord;
    }


    public String getUserName() {
        return userName;
    }


    public void setUserName(String userName) {
        this.userName = userName;
    }

    public String getPassWord() {
        return passWord;
    }


    public void setPassWord(String passWord) {
        this.passWord = passWord;
    }

    //比较属性值
    @Override
    public boolean equals(Object o) {
        if (o == null || getClass() != o.getClass()) return false;
        User user = (User) o;
        return Objects.equals(userName, user.userName) && Objects.equals(passWord, user.passWord);
    }


    public String toString() {
        return "User{userName = " + userName + ", passWord = " + passWord + "}";
    }
}
